Use sync-first TDS cursor reads in ODBC - #307
Draft
Saurabh Singh (saurabh500) wants to merge 1 commit into
Draft
Conversation
Saurabh Singh (saurabh500)
changed the base branch from
dev/saurabh500/tds-cursor-hot-path
to
dev/saurabh500/tds-sync-first-cursor
August 15, 2026 18:41
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Saurabh Singh (saurabh500)
force-pushed
the
dev/saurabh500/odbc-sync-first-cursor
branch
from
August 15, 2026 19:11
c7fe816 to
983a858
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Layer 4 (top) of a separate experimental performance stack.
Updates the existing row-at-a-time / column-at-a-time ODBC paths to use layer 3's explicit sync-first TDS cursor APIs:
SQLFetchcallstry_next_row_cursorbefore the async fallback.SQLGetDatacallstry_read_row_columnbefore the async fallback.CursorPoll::Readybypasses Tokio;CursorPoll::Pendinginvokes the existing async method exactly once.All existing client ownership, DBC/statement locking, diagnostics, INFO handling, active-statement state, PLP behavior, timeout/cancellation behavior, and error recovery remain unchanged. This does not batch, prefetch, or materialize whole rows.
Stack parent: #306
Linux benchmark
SQL Server 2022 in Podman, unixODBC,
Encrypt=No,TrustServerCertificate=Yes, CPUs 8-15. Each process used two warmups and seven measured passes over 200,000 rows withSQLExecDirect + SQLFetch + four sequential SQLGetDatacalls (INT,BIGINT,NVARCHAR,BIT). Runs were counterbalanced parent/candidate/candidate/parent.Raw result data is retained in the authoring session artifacts.
Correctness coverage
The
resolve_cursor_polltests prove:The full loadable-driver e2e suite passes against SQL Server, covering SQLFetch, SQLGetData, PLP, result navigation, transactions, and recovery through unixODBC.
Validation
cargo fmt --all -- --checkcargo nextest run -p mssql-odbc --no-fail-fast— 551 passedcargo clippy -p mssql-odbc --frozen --all-features --all-targets -- -D warningsmssql-odbc/tests/e2e/run_e2e.sh --release --driver=...— 19/19 test binaries passedLimitations
The sync-first coverage is defined by layer 3. PLP, encrypted, skipped, unsupported, incomplete, and control-token paths continue through the existing async implementation.
Related Issues
Related to #306.
Checklist